package com.supercube.sport.yoga.service.impl;

import com.supercube.sport.yoga.dao.HomeMapper;
import com.supercube.sport.yoga.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Description：
 * Created By guowen
 */
@Service
public class HomeServiceImpl implements HomeService {
    @Autowired
    private HomeMapper homeMapper;
    @Override
    public int getNotCardCount(){
        return homeMapper.getNotCardCount().size();
    }
    @Override
    public int getFutureClassesCount(int days){
        return homeMapper.getFutureClassesCount(days).size();
    }

    @Override
    public int getMemberExpirationCount(int days){
        return homeMapper.getMemberExpirationCount(days).size();
    }

    @Override
    public int getMemberBirthdayCount(int days){
        return homeMapper.getMemberBirthdayCount(days).size();
    }

    @Override//失效
    public Map<String, Integer> getMemberChangeCount(String type,String sDate){
        List addCount =  homeMapper.getMemberAddCount(type,sDate);
        List invalidCount = homeMapper.getMemberInvalidCount(type,sDate);
        Map<String, Integer> map = new HashMap<>();
        map.put("addCount",addCount.size());
        map.put("invalidCount",invalidCount.size());
        return map;
    }

}
